<%--
  Created by IntelliJ IDEA.
  User: xianfei
  Date: 15-4-29
  Time: 上午9:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>漫庭网</title>
    <script>
        $(function () {
            $('.carousel').carousel({
                interval: 6000,
                pause: "hover"
            });
            $(".area:first a").addClass("bgColor");
            $(".price:first a").addClass("bgColor");
            $(".common:first a").addClass("bgColor");
            $(".theme:first a").addClass("bgColor");
        });

        function jumpToHouseTypeList(id) {
            window.open("/front/houseBase/showType/" + id + "/apartment");
        }

        //a标签的单击事件，改变背景颜色
        function aClick(event) {
            var tag = event.srcElement || event.target;//找到单击被点击的元素
            var father = tag.parentNode;//找到最近的一个div标签
            while (father.nodeName != "DIV")//如果tag的父级标签不是div标签则继续往上找
            {
                father = father.parentNode;
            }
            var fatherID = father.id;//找到tag标签最近一个父级div标签的id

            //将fatherID该div对象下面的所有a标签，将各个a标签的className属性清空
            for (var i = 0; i < document.getElementById(fatherID).getElementsByTagName("a").length; i++) {
                document.getElementById(fatherID).getElementsByTagName("a")[i].className = "";
            }

            //为事件源tag对象添加className样式
            tag.className = 'bgColor';

        }
        function search() {
            var area = $(".area [class=bgColor]");
            var price = $(".price [class=bgColor]");
            var theme = $(".theme [class=bgColor]");
            var apartmentName = $("#txtaddress").val();
            $("#apartmentData").empty();
            $("#apartmentData").load("/front/houseBase/search", {area: area.html(), price: price.html(), theme: theme.html(), productType: "APARTMENT", houseBaseName: apartmentName});
        }
    </script>
</head>
<body>
<input type="hidden" id="pageType" value="apartment">

<div class="container">
    <div class="list">
        <div class="left">
            <div class="screen-top">
                <div class="left"><input id="txtaddress" type="text" class="txt01"/></div>
                <div class="left">
                    <button type="button" class="btn2 searchbtn" onclick="search()">搜索</button>
                </div>
            </div>
            <div id="screen">
                <div id="region">
                    <span class="type"><strong>区域：</strong></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">不限</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">三亚</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">海口</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">丽江</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">西双版纳</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">深圳</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">广州</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">成都</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">昆明</a></span>
                    <span class="area"><a href="javascript:void(0)" onclick="aClick(event)">重庆</a></span>
                </div>
                <div id="price">
                    <span class="type"><strong>价格：</strong></span>
                    <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">不限</a></span>
                    <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">5万以下</a></span>
                    <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">5-10万</a></span>
                    <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">10-15万</a></span>
                    <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">15-20万</a></span>
                    <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">20-30万</a></span>
                    <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">30-50万</a></span>

                    <p style="text-indent:53px">
                        <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">50-70万</a></span>
                        <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">70-100万</a></span>
                        <span class="price"><a href="javascript:void(0)" onclick="aClick(event)">100万以上</a></span>
                    </p>
                </div>
                <div id="subject">
                    <span class="type"><strong>主题：</strong></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">不限</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">高尔夫</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">温泉</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">沙滩</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">湖景</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">雪山</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">古镇</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">避寒</a></span>
                    <span class="theme"><a href="javascript:void(0)" onclick="aClick(event)">避暑</a></span>
                </div>
            </div>
        </div>
        <div class="right" style="width: 550px"><a href="javascript:void(0)"><img src="/public/img/apartmeng_gv.jpg"></a>
        </div>
    </div>
    <div style="clear:both; float:none"></div>
    <div class="t14"><h2 class="title02">度假公寓</h2></div>
    <div id="apartmentData">
        <jsp:include page="houseBaseData.jsp"></jsp:include>
    </div>


</div>
</body>
</html>